package cn.yshujia.transform;

import cn.yshujia.domain.entity.Article;
import cn.yshujia.domain.vo.ArticleVO;

/**
 * @author YShuJia
 * @create 2024/11/28
 * @description ArticleTransform
 */

public class ArticleTransform {
	
	public static ArticleVO entity2VO (Article article) {
		if (article == null) {
			return null;
		}
		ArticleVO articleVO = new ArticleVO();
		articleVO.setId(article.getId());
		articleVO.setTitle(article.getTitle());
		articleVO.setCover(article.getCover());
		articleVO.setContent(article.getContent());
		articleVO.setLikeCount(article.getLikeCount());
		articleVO.setViewCount(article.getViewCount());
		articleVO.setHasVideo(article.getHasVideo());
		articleVO.setVideoUrl(article.getVideoUrl());
		articleVO.setTips(article.getTips());
		articleVO.setIsRecommend(article.getIsRecommend());
		articleVO.setIsComment(article.getIsComment());
		articleVO.setCreateTime(article.getCreateTime());
		articleVO.setUpdateTime(article.getUpdateTime());
		articleVO.setOrigin(article.getOrigin());
		articleVO.setStatus(article.getStatus());
		return articleVO;
	}
}
